#include <iostream>
#include <string>
using namespace std;

int main()
{
	const int LEN = 3;
	//
	int* myNumbers = new int[LEN];
	cout << hex << myNumbers << endl;
	// 退出前取消分配
	delete[] myNumbers;
	//
	int* pointsToInts = new int[LEN];
	for (int counter = 0; counter < LEN; ++counter)
	{
		cin >> *(pointsToInts + counter);
		cout << (pointsToInts + counter) << endl;
	}

	for (int counter = 0; counter < LEN; ++counter) {
		cout << *(pointsToInts++) << endl;
	}
		
	// 将指针返回到初始位置
	pointsToInts -= LEN;
	cout << pointsToInts << endl;
	// 使用内存完成释放
	delete[] pointsToInts;
    //
    int myNumbers[5];
   // Pointer initialized to array
   int* pointToNums = myNumbers;
   // Display address contained in pointer
   cout << hex << pointToNums << endl;
   // Address of first element of array
   cout << hex << &myNumbers[0] << endl;
   //
    int myNumbers[LEN] = { 24, -1, 365 };
    int* pointToNums = myNumbers;
    for (int index = 0; index < LEN; ++index) {
        cout << index << " = " << *(myNumbers + index) << endl;
        cout << index << " = " << pointToNums[index] << endl;
    }


	return 0;
}